package com.pyb.java.commonutil.image;

import androidx.annotation.DrawableRes;

public class DisplayOption {
    public Integer loadingRes;
    public Integer defaultRes;
    public Integer emptyRes;
    public Integer onFailRes;
    public Integer maxWidth;
    public Integer maxHeight;
    public Boolean cacheInMemory = true;
    public Boolean cacheOnDisk = true;

    private DisplayOption() {
    }

    public DisplayOption setLoadingRes(@DrawableRes int loadingRes) {
        this.loadingRes = loadingRes;
        return this;
    }

    public DisplayOption setDefaultRes(@DrawableRes int defaultRes) {
        this.defaultRes = defaultRes;
        return this;
    }

    public DisplayOption setOnFailRes(@DrawableRes int onFailRes) {
        this.onFailRes = onFailRes;
        return this;
    }

    public DisplayOption setMaxWidth(int maxWidth) {
        this.maxWidth = maxWidth;
        return this;
    }

    public DisplayOption setMaxHeight(int maxHeight) {
        this.maxHeight = maxHeight;
        return this;
    }

    public DisplayOption setCacheInMemory(boolean cacheInMemory) {
        this.cacheInMemory = cacheInMemory;
        return this;
    }

    public DisplayOption setCacheOnDisk(boolean cacheOnDisk) {
        this.cacheOnDisk = cacheOnDisk;
        return this;
    }

    public DisplayOption setEmptyRes(int emptyRes){
        this.emptyRes = emptyRes;
        return this;
    }

    public static DisplayOption builder() {
        return new DisplayOption();
    }

}
